use core::{Package, VirtualManifest, EitherManifest, SourceId};
use core::{PackageIdSpec, Dependency, Profile, Profiles};
use ops;
-use util::{Config, CargoResult, Filesystem, human};
+use util::{Config, CargoResult, Filesystem, human, ChainError};
use util::paths;
/// The core abstraction in Cargo for working with a workspace of crates.
Some(p) => p,
None => return Ok(Vec::new()),
};
- let res = glob(path).map_err(|e| {
- human(format!("could not parse pattern `{}`: {}", &path, e))
+ let res = glob(path).chain_error(|| {
+ human(format!("could not parse pattern `{}`", &path))
})?;
res.map(|p| {
- p.or_else(|e| {
- Err(human(format!("unable to match path to pattern `{}`: {}", &path, e)))
+ p.chain_error(|| {
+ human(format!("unable to match path to pattern `{}`", &path))
})
}).collect()
}
use curl;
use git2;
+use glob;
use semver;
use serde_json;
use term;
term::Error,
num::ParseIntError,
str::ParseBoolError,
+ glob::PatternError,
+ glob::GlobError,
}
impl From<string::ParseError> for Box<CargoError> {
impl CargoError for term::Error {}
impl CargoError for num::ParseIntError {}
impl CargoError for str::ParseBoolError {}
+impl CargoError for glob::PatternError {}
+impl CargoError for glob::GlobError {}
// =============================================================================
// Construction helpers